package com.example.cr.insect.repository;

import com.example.cr.insect.entity.PestFrequency;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PestFrequencyRepository extends JpaRepository<PestFrequency, Long> {

    @Query("SELECT pf FROM PestFrequency pf JOIN FETCH pf.farm ORDER BY pf.farm.id, pf.month")
    List<PestFrequency> findAllWithFarm();
}
